<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml" layout:decorate="~{layout/template}">
<head>
    <title>数据查询</title>
    <link rel="stylesheet" href="/css/operations/dbquery.css"/>
</head>
<body>
<div id="contentContainer" layout:fragment="content" class="contentContainer" v-cloak>

    <el-row id="toolbar">
        <el-col>
            <el-form :model="form" :rules="rules" ref="form">
                <el-form-item prop="sql">
                    <el-input
                            type="textarea"
                            :autosize="{ minRows: 2, maxRows: 4}"
                            placeholder="请输入SQL语句"
                            v-model="form.sql">
                    </el-input>
                </el-form-item>
                <el-form-item class="pull-right">
                    <el-button type="primary" @click="submitForm('form')">
                        <i class="fa fa-search"></i>
                        <span>查询</span>
                    </el-button>
                    <el-button @click="onExport('form')">导出</el-button>
                    <el-button @click="resetForm('form')">重置</el-button>
                </el-form-item>
            </el-form>
        </el-col>
    </el-row>

    <el-row>
        <el-table
                border
                tooltip-effect="light"
                class="dataTable"
                :data="tableData"
                :height="tableHeight">
            <el-table-column
                    v-for="col in cols"
                    :prop="col"
                    :label="col">
            </el-table-column>
        </el-table>
    </el-row>

    <el-row id="pagination">
        <div class="pull-right">
            <el-pagination
                    layout="total, sizes, prev, pager, next, jumper"
                    :current-page="form.pageNum"
                    :page-size="form.pageSize"
                    :page-sizes="pageSizes"
                    :total="total"
                    @size-change="onSizeChange"
                    @current-change="onCurrentChange">
            </el-pagination>
        </div>
    </el-row>

</div>

<th:block layout:fragment="staticFile">
    <script src="/js/operations/dbquery.js"></script>
</th:block>

</body>
</html>